function Namecheck()
{
    let name = document.getElementById('user');
    let a = document.getElementById('nameexist');
    if(name.value!='')
    {
        // let b = document.getElementById('correct_icon1');
        $.ajax({
            url:"/user/User/namecheck",
            type:"post",
            dataType:"html",
            data:{UserName:$("#user").val()},
            success:function(data)
            {
                if(data == 1)
                {
                    a.style.display = 'none';
                    // b.style.display = 'none';
                    Lockbtn();
                }else
                {
                    a.style.display = 'block';
                    // b.style.display = 'block';
                    Lockbtn();
                }
            },
            error:function()
            {
            }
        }
        )
    }else
    {
        if(a.style.display == 'block'){
            a.style.display = 'none';
        }
        Lockbtn();
        return;
    }
}
function Lockbtn(){
    let a = document.getElementById('nameexist');
    let btn = document.getElementById('comfirm');
    let name = document.getElementById('user');
    if( a.style.display == 'block'|| name.value == ''){
        btn.classList.add('am-disabled');
    }else{
        btn.classList = 'am-btn am-btn-secondary am-btn-sm';
    }
}